
//类名 采用大驼峰
class WashMachine{
    public String brand;//品牌
    public String type;//型号
    public double weight;//重量
    public double length;//长
    public double width;//宽
    public double height;//高
    public String color;//颜色

    public void washClothes(){ // 洗衣服
        System.out.println("洗衣功能");
    }
    public void dryClothes(){ // 脱水
        System.out.println("脱水功能");
    }
    public void setTime(){ // 定时
        System.out.println("定时功能");
    }
}
class Dog {
    public String name;//名字
    public int age;//年龄
    public String color;//颜色
    // 狗的属性

    public void eat() {
        System.out.println(name + "吃饭!");
    } // 狗的行为
    public void bark() {
        System.out.println(name + "旺旺!");
    }
}

public class TestDemo {
    public static void main(String[] args) {
        Dog dog = new Dog();
        dog.name = "旺财";
        dog.eat();
        dog.bark();

        Dog dog2 = new Dog();
        dog2.name = "阿黄";
        dog2.eat();
        dog2.bark();
    }


    public static void main1(String[] args) {
        Dog dog = new Dog();//通过new关键字来实例化一个Dog对象
        System.out.println(dog.name);
        dog.name = "旺财";
        System.out.println(dog.name);
        int a = 10;
    }
}
